Skip to content

feat(domain): 项目/角色模块 CRUD + 归属校验 - #150

Merged
xiaocheny214 merged 5 commits into
1024XEngineer:mainfrom
xiaocheny214:feat/domain-modules
Aug 10, 2026
Merged

feat(domain): 项目/角色模块 CRUD + 归属校验#150
xiaocheny214 merged 5 commits into
1024XEngineer:mainfrom
xiaocheny214:feat/domain-modules

Conversation

@xiaocheny214

@xiaocheny214 xiaocheny214 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

概述

在 main 最新基础上,实现项目(Project)和角色(Character)两个领域模块的完整 CRUD,包含归属校验与跨用户权限测试。

包含内容

项目模块(server/project + web/api/project)

  • SqlAlchemyProjectService:create / get / list / delete + 名称去重
  • API 端点:POST/GET/DELETE /projects
  • JWT 归属校验(user_id 从 token 取,校验 project.user_id)

角色模块(server/character + web/api/character)

  • SqlAlchemyCharacterService:create / get / list / update / delete
  • API 端点:POST/GET/PATCH/DELETE /characters
  • workflow_run_id 必填字段(关联 workflow_run,暂无外键约束)
  • outfit → action → frame 嵌套数据(CharacterData Pydantic 模型)
  • 归属校验:通过 project_id 反查 project.user_id,统一返回"角色不存在"避免信息泄露

路由注册(bootstrap/app.py)

  • 注册 project_routercharacter_router

测试(17 用例全通过)

test_project_api.py(9 用例)

  • 创建成功 / 重名 400 / 校验失败 400
  • 查询成功 / 404
  • 列表空 / 分页
  • 删除成功 / 404

test_character_api.py(8 用例)

  • 创建(含 name / 不含 name / 名称读回)
  • 跨用户权限校验(5 用例):用户 B 无法 create / list / get / update / delete 用户 A 的角色

关联

@xiaocheny214 xiaocheny214 added the enhancement New feature or request label Aug 6, 2026
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
windup Ignored Ignored Preview Aug 10, 2026 2:46am

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found three concrete regressions; details are inline.

Comment thread backend/packages/app/src/windup_app/web/api/character.py
Comment thread backend/packages/app/src/windup_app/server/user/service.py
Comment thread docker-compose.yml Outdated
@xiaocheny214 xiaocheny214 changed the title feat(domain): 领域模块——项目/角色/工作流/Agent feat(domain): 项目/角色模块 CRUD + 归属校验 Aug 10, 2026
@xiaocheny214
xiaocheny214 requested a review from huyanxius August 10, 2026 02:52
@huyanxius

Copy link
Copy Markdown
Collaborator

没发现问题,可以合并

@xiaocheny214
xiaocheny214 merged commit 1680781 into 1024XEngineer:main Aug 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: 为 Character 增加稳定显示名 name

2 participants